package com.sx.widget.log;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.databinding.DataBindingUtil;
import androidx.viewpager.widget.ViewPager;

import com.google.android.material.tabs.TabLayout;
import com.sx.widget.R;
import com.sx.widget.app.dialog.BaseDialog;
import com.sx.widget.databinding.DialogLogBinding;

/**
 * @Description
 * @Author 梁浩文
 * @Date 2021/7/13 10:12
 */
public class LogDialog {
    public class Builder extends BaseDialog.Builder<Builder> {
        public DialogLogBinding binding;
        private String[] tabTextArrays = {"Log", "System"};

        public Builder(Context context) {
            super(context);
            setContentView(R.layout.dialog_log);
            binding = DataBindingUtil.getBinding(getContentView());
            binding.logClear.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    LogUtils.logW.clean();
                    LogUtils.logD.clean();
                    LogUtils.logI.clean();
                    LogUtils.logE.clean();
                    LogUtils.logV.clean();
                }
            });
            for (String tabTextArray : tabTextArrays) {
                TabLayout.Tab tab = binding.logTab.newTab().setText(tabTextArray);
                binding.logTab.addTab(tab);
            }
            binding.logTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
                @Override
                public void onTabSelected(TabLayout.Tab tab) {
                    switch (tab.getPosition()) {
                        case 0:
                            break;
                        case 1:
                            break;
                        case 2:
                            break;
                        case 3:
                            break;
                        case 4:
                            break;
                        case 5:
                            break;
                    }
                }

                @Override
                public void onTabUnselected(TabLayout.Tab tab) {

                }

                @Override
                public void onTabReselected(TabLayout.Tab tab) {

                }
            });
        }

    }
}
